const isLogin = (): string => {
    return localStorage.getItem('token') || ''
}

const getUserInfo = (): string => {
    return localStorage.getItem('userInfo') || ''
}

const getMomentInfo = (): string => {
    return localStorage.getItem('momentInfo') || ''
}

const setTokenLocalStrage = (token: string): void => {
    localStorage.setItem('token', token)
}

const setUserInfoLocalStrage = (userInfo: string): void => {
    localStorage.setItem('userInfo', JSON.stringify(userInfo))
}

const setMomentInfoLocalStrage = (momentInfo: string): void => {
    localStorage.setItem('momentInfo', JSON.stringify(momentInfo))
}

const clearLocalStrage = (): void => {
    localStorage.clear()
}

export {isLogin, setTokenLocalStrage, setUserInfoLocalStrage, setMomentInfoLocalStrage, getUserInfo, getMomentInfo, clearLocalStrage}
